Skip to content

fix(solid-query): render resolved SSR value for deferred queries#10957

Open
brenelz wants to merge 1 commit into
TanStack:solid-query-v6-prefrom
brenelz:fix/solid-query-ssr-deferred-hydration
Open

fix(solid-query): render resolved SSR value for deferred queries#10957
brenelz wants to merge 1 commit into
TanStack:solid-query-v6-prefrom
brenelz:fix/solid-query-ssr-deferred-hydration

Conversation

@brenelz

@brenelz brenelz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

When a deferred query (prefetched but not awaited) is read inside a Loading/Suspense boundary, SSR rendered the stale loading state and the client hydrated into a frozen subtree ("unclaimed server-rendered node").

On the server the result proxy forced a queryResource() read to create the Suspense dependency, but returned property values from the state store. When the boundary suspends and re-renders after the query settles, state is never synced (the server subscriber resolves the resource Promise but does not write the store), so the retry render read stale loading values. The serialized resource, however, held the resolved result — so server DOM (loading) and the hydrated resource (success) disagreed, breaking hydration.

Read property values from the resolved resource instead of state, so the streamed SSR HTML matches the serialized resource the client hydrates against.

🎯 Changes

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

When a deferred query (prefetched but not awaited) is read inside a
Loading/Suspense boundary, SSR rendered the stale loading state and the
client hydrated into a frozen subtree ("unclaimed server-rendered node").

On the server the result proxy forced a `queryResource()` read to create
the Suspense dependency, but returned property values from the `state`
store. When the boundary suspends and re-renders after the query settles,
`state` is never synced (the server subscriber resolves the resource
Promise but does not write the store), so the retry render read stale
loading values. The serialized resource, however, held the resolved
result — so server DOM (loading) and the hydrated resource (success)
disagreed, breaking hydration.

Read property values from the resolved resource instead of `state`, so
the streamed SSR HTML matches the serialized resource the client
hydrates against.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 792354e1-c63f-4305-953c-a810349de62d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant